<?php

use App\Models\Cruise\CruiseCheckSelfTaskModel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterCruiseCheckSelfTaskAddExecuteType extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('cruise_check_self_task', function (Blueprint $table) {
//            $table->unsignedTinyInteger("executeType")->after("taskEndTime")
//                  ->default(CruiseCheckSelfTaskModel::EXECUTE_TYPE_CUSTOM)
//                  ->comment(enumToMigrationComment(CruiseCheckSelfTaskModel::EXECUTE_TYPE_TEXT, "执行类型"));


            $table->unsignedTinyInteger("executeStartBefore")->after("executeEndHis")->default(0)
                  ->comment("执行类型为门店营业时间 - 提前时间（小时）");
            $table->unsignedTinyInteger("executeEndAfter")->after("executeEndHis")->default(0)
                  ->comment("执行类型为门店营业时间 - 延后时间（小时）");
            $table->unsignedTinyInteger("sysTemplate")->default(0)->comment("模板类型")->after("templateType");

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('cruise_check_self_task', function (Blueprint $table) {
            $table->dropColumn([
//                "executeType",
                "executeStartBefore",
                "executeEndAfter",
                "sysTemplate"
            ]);
        });
    }
}
